import $req, { HttpMethod } from './indexs';

enum API {
  setdescription = "/api/set/description",
  description = '/api/city/description',
  customsList = "/api/customs/list",
  viewList = "/api/view/list",
  footList = "/api/food/list",
  footAddress = "/api/food/address-list",
  captcha = "/api/send/captcha",
  login = "/api/user/login",
  addFoot = "/api/food/add",
  uploadFoot = "/api/food/update",
  deleteFoot = "/api/food/delete",
  addView = "/api/view/add",
  uploadView = "/api/view/update",
  deleteView = "/api/view/delete",
  addCustoms = "/api/customs/add",
  updateCustoms = "/api/customs/update",
  deleteCustoms = "/api/customs/delete"
}

// 获取简介
export const description:any = () => $req(API.description); 

//获取节日
export const customsList:any = (params:any) => $req(API.customsList,{body:params,method: HttpMethod.post},'json');

//获取景点
export const viewList:any = (params:any) => $req(API.viewList,{body:params,method: HttpMethod.post},'json');

//获取美食
export const footList:any = (params:any) => $req(API.footList,{body:params,method: HttpMethod.post},'json');

// 获取食物address
export const footAddress:any = () => $req(API.footAddress); 

//获取验证码
export const captcha:any = (params:any) => $req(API.captcha,{body:params,method: HttpMethod.post});

//登录
export const login:any = (params:any) => $req(API.login,{body:params,method: HttpMethod.post},'json');

//set简介
export const setdescription:any = (params:any) => $req(API.setdescription,{body:params,method: HttpMethod.post});

//添加食物
export const addFoot:any = (params:any) => $req(API.addFoot,{body:params,method: HttpMethod.post},'blob');

//修改食物
export const uploadFoot:any = (params:any) => $req(API.uploadFoot,{body:params,method: HttpMethod.post},'blob');

//删除食物
export const deleteFoot:any = (params:any) => $req(API.deleteFoot+`/${params}`); 

//添加景点
export const addView:any = (params:any) => $req(API.addView,{body:params,method: HttpMethod.post},'blob');

//修改景点
export const uploadView:any = (params:any) => $req(API.uploadView,{body:params,method: HttpMethod.post},'blob');

//删除景点
export const deleteView:any = (params:any) => $req(API.deleteView+`/${params}`); 

//添加节日
export const addCustoms:any = (params:any) => $req(API.addCustoms,{body:params,method: HttpMethod.post},'blob');

//修改修改
export const updateCustoms:any = (params:any) => $req(API.updateCustoms,{body:params,method: HttpMethod.post},'blob');

//删除景点
export const deleteCustoms:any = (params:any) => $req(API.deleteCustoms+`/${params}`); 